<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
 <head>
  <meta http-equiv="content-type" content="text/html; charset=UTF-8">
  <title>获取会话 cookie 参数</title>
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-base.css" />
<link media="all" rel="stylesheet" type="text/css" href="styles/03e73060321a0a848018724a6c83de7f-theme-medium.css" />

 </head>
 <body class="docs"><div class="navbar navbar-fixed-top">
  <div class="navbar-inner clearfix">
    <ul class="nav" style="width: 100%">
      <li style="float: left;"><a href="function.session-gc.html">« session_gc</a></li>
      <li style="float: right;"><a href="function.session-id.html">session_id »</a></li>
    </ul>
  </div>
</div>
<div id="breadcrumbs" class="clearfix">
  <ul class="breadcrumbs-container">
    <li><a href="index.html">PHP Manual</a></li>
    <li><a href="ref.session.html">Session 函数</a></li>
    <li>获取会话 cookie 参数</li>
  </ul>
</div>
<div id="layout">
  <div id="layout-content"><div id="function.session-get-cookie-params" class="refentry">
 <div class="refnamediv">
  <h1 class="refname">session_get_cookie_params</h1>
  <p class="verinfo">(PHP 4, PHP 5, PHP 7, PHP 8)</p><p class="refpurpose"><span class="refname">session_get_cookie_params</span> &mdash; <span class="dc-title">获取会话 cookie 参数</span></p>

 </div>
 
 <div class="refsect1 description" id="refsect1-function.session-get-cookie-params-description">
  <h3 class="title">说明</h3>
  <div class="methodsynopsis dc-description">
   <span class="methodname"><strong>session_get_cookie_params</strong></span>(): <span class="type">array</span></div>

  <p class="para rdfs-comment">
   获取会话 cookie 的参数。
  </p>
 </div>


 <div class="refsect1 returnvalues" id="refsect1-function.session-get-cookie-params-returnvalues">
  <h3 class="title">返回值</h3>
  <p class="para">
   返回一个包含当前会话 cookie 信息的数组：
   <ul class="itemizedlist">
    <li class="listitem">
     <span class="simpara">
      <a href="session.configuration.html#ini.session.cookie-lifetime" class="link">&quot;lifetime&quot;</a> - cookie 的生命周期，以秒为单位。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <a href="session.configuration.html#ini.session.cookie-path" class="link">&quot;path&quot;</a> -  cookie 的访问路径。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <a href="session.configuration.html#ini.session.cookie-domain" class="link">&quot;domain&quot;</a> -  cookie 的域。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <a href="session.configuration.html#ini.session.cookie-secure" class="link">&quot;secure&quot;</a> -  仅在使用安全连接时发送 cookie。
     </span>
    </li>
    <li class="listitem">
     <span class="simpara">
      <a href="session.configuration.html#ini.session.cookie-httponly" class="link">&quot;httponly&quot;</a> - 只能通过 http 协议访问 cookie
     </span>
    </li>
   </ul>
  </p>
 </div>


 <div class="refsect1 changelog" id="refsect1-function.session-get-cookie-params-changelog">
  <h3 class="title">更新日志</h3>
  <p class="para">
   <table class="doctable informaltable">
    
     <thead>
      <tr>
       <th>版本</th>
       <th>说明</th>
      </tr>

     </thead>

     <tbody class="tbody">
      <tr>
       <td>5.2.0</td>
       <td>
        在返回数组中加入 “httponly”。
       </td>
      </tr>

      <tr>
       <td>4.0.4</td>
       <td>
        在返回数组中加入 “secure”。
       </td>
      </tr>

     </tbody>
    
   </table>

  </p>
 </div>


 <div class="refsect1 seealso" id="refsect1-function.session-get-cookie-params-seealso">
  <h3 class="title">参见</h3>
  <p class="para">
   <ul class="simplelist">
    <li class="member"><a href="session.configuration.html#ini.session.cookie-lifetime" class="link">session.cookie_lifetime</a></li>
    <li class="member"><a href="session.configuration.html#ini.session.cookie-path" class="link">session.cookie_path</a></li>
    <li class="member"><a href="session.configuration.html#ini.session.cookie-domain" class="link">session.cookie_domain</a></li>
    <li class="member"><a href="session.configuration.html#ini.session.cookie-secure" class="link">session.cookie_secure</a></li>
    <li class="member"><a href="session.configuration.html#ini.session.cookie-httponly" class="link">session.cookie_httponly</a></li>
    <li class="member"><span class="function"><a href="function.session-set-cookie-params.html" class="function" rel="rdfs-seeAlso">session_set_cookie_params()</a> - 设置会话 cookie 参数</span></li>
   </ul>
  </p>
 </div>


</div></div></div></body></html>